package com.example.demo.mapper;

import com.example.demo.entity.Role;
import org.apache.ibatis.annotations.*;

import java.util.List;


@Mapper
public interface RoleMapper {
    @Insert("insert into role(id,cname,cremark)values(#{id},#{cname},#{cremark})")
    public int insert(Role role);
    @Select("select * from role")
    public List<Role> search();
    @Select("select * from role where cname like '%${cname}%';")
    public List<Role> searchByName(String cname);
    @Delete("delete from role where id = #{id}")
    public int delete(int id);
    @Update("update role set cname=#{cname},cremark=#{cremark} where id=#{id}")
    public int update(Role role);
}
